using SG.Lang.Dry.Base;
using SG.Lang.Dry.Controlling;
using SG.Lang.Dry.Mirrors;

namespace SG.Lang.Dry.Code
{
    public abstract class Expression : Element
    {
        private readonly Expression _left;
        private readonly Expression _value;
        private readonly Expression _right;

        protected Expression(ref ElementRecord elementRecord, ref ExpressionRecord expressionRecord) : base(ref elementRecord)
        {
            _left = expressionRecord.Left.ResolveExpression();
            _value = expressionRecord.Value.ResolveExpression();
            _right = expressionRecord.Right.ResolveExpression();
        }

        public Expression Left { get { return _left; } }

        public Expression Value { get { return _value; } }

        public Expression Right { get { return _right; } }

    }
}